skb=input()
isError='yes'
mass=[]
for i in skb:
    if '[' == i == '(' or i == '{':
        mass.append(i)
    elif mass:
        if ']' == i and mass[-1] == '[':
            mass.pop()
        elif ')' == i and mass[-1] == '(':
            mass.pop()
        elif '}' == i and mass[-1] == '{':
            mass.pop()
        else:
            isError = 'no'
    else:
         isError='no'
print(isError)
